from rest_framework import serializers
from rest_framework.validators import UniqueValidator
from apps.HttpTestcase.models import Envs
# from debugtalks.models import Debugtalks
from apps.HttpTestcase.models import Interfaces


class EnvModeSerializer(serializers.ModelSerializer):
    create_time = serializers.DateTimeField(format="%Y-%m-%d %H:%M:%S", required=False, read_only=True)

    class Meta:
        model = Envs
        exclude = ('update_time', 'is_delete')
        extra_kwargs = {
            'create_time': {
                "read_only": True
            },
        }


class ReadsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Envs
        fields = ('id', 'name', 'base_url', 'desc', 'create_time','is_active')
